<?php

	class bizClass
	{
		public $name;
		
		function __construct($inName=null)
		{
			$this->name = $inName;
		}
		
		function createBusiness($inName, $inPass, $inEmail, $inDescription)
		{
			$query = sprintf("SELECT name FROM bus_acct WHERE name = '$inName'");
			$return = mysql_query($query);
			$result = mysql_result($return,0,0);
			if( $result )
			{
				echo "username taken";
			}
			else
			{
				$query = sprintf("INSERT INTO bus_acct (name,pass,email,description) VALUES ('$inName','$inPass','$inEmail','$inDescription')");
				$result = mysql_query($query);					
									
				$message = "Success"; 

				if (!$result) {
					$message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message);
				} echo $message;
									
			}		
		}
		
		function getEmail()
		{
			$query = springf("SELECT email FROM bus_acct WHERE name = $this->name");
			$result = mysql_query($query);
			return mysql_result( $result,0,0 );
		}
		
		function getDescription()
		{
			$query = springf("SELECT description FROM bus_acct WHERE name = $this->name");
			$result = mysql_query($query);
			return mysql_result( $result,0,0 );
		}
		
	}
	
	
	
	
	
	

?>